package xyz.mkkbjb.utils.result;

import xyz.mkkbjb.comment.ResponseResult;

public class ResultSet {
	private final static String SUCCESS = "success";
	
		public static <T> ResponseResult<T> makeOKRsp() {
			return new ResponseResult<T>().setCode(ResultCode.SUCCESS).setMsg(SUCCESS);
		}
	
		public static <T> ResponseResult<T> makeOKRsp(T data) {
			return new ResponseResult<T>().setCode(ResultCode.SUCCESS).setMsg(SUCCESS).setData(data);
		}
	
		public static <T> ResponseResult<T> makeErrRsp(String message) {
			return new ResponseResult<T>().setCode(ResultCode.FAIL).setMsg(message);
		}
	
		public static <T> ResponseResult<T> makeRsp(int code, String msg) {
			return new ResponseResult<T>().setCode(code).setMsg(msg);
		}
		
		public static <T> ResponseResult<T> makeRsp(int code, String msg, T data) {
			return new ResponseResult<T>().setCode(code).setMsg(msg).setData(data);
		}
}

